package web.java.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import web.java.entity.Employee;
import web.java.service.impl.EmpServiceImpl;

public class ListServlet extends HttpServlet {
	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		EmpServiceImpl service=new EmpServiceImpl();
		List<Employee> list=service.getAll();
		request.setAttribute("list",list);
		request.getRequestDispatcher("index.jsp").forward(request,response);
	}
	
}
